﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SCCN.BLL;
using SCCN.Utility;

public partial class Admin_AddCategory : System.Web.UI.Page
{
    CategoryBLL bllCategoryBLL = new CategoryBLL();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }
    }

    /// <summary>
    /// 添加分类
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string categoryName = this.txtCategoryName.Text;
        SCCN.DAL.SC_Category obj = new SCCN.DAL.SC_Category();
        obj.CategoryName = this.txtCategoryName.Text;
        obj.IsDelete = false;
        if (bllCategoryBLL.AddCategory(obj))
        {
            HttpHelper.Alert("添加成功！", Page);
        }
        else
        {
            HttpHelper.Alert("添加失败！", Page);
        }
    }

    /// <summary>
    /// return
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReturn_Click(object sender, EventArgs e)
    {
        Response.Redirect("CategoryList.aspx");
    }
}